package cn.itcast.bos.web.action.base;


import cn.itcast.bos.domain.base.Standard;
import cn.itcast.bos.service.base.StandardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by xbqco on 2018/7/10.
 */
@Controller
public class StandardController {

    @Autowired
    private StandardService standardService;

    @RequestMapping("standard_save")
    public String save(Standard standard1){
        standardService.save(standard1);
        return "redirect:/pages/base/standard.html";
    }

    @RequestMapping("standard_findAll")
    @ResponseBody
    public List<Standard> findAll(){
       return  standardService.findAll();

    }
}
